package model

import (
	"gorm.io/gorm"
	__ "videosS_rpc/basic/proto"
)

type Bullet struct {
	gorm.Model
	VideoId   int    `gorm:"type:int;commit:视频ID;"`
	EpisodeId int    `gorm:"type:int;commit:集数ID;"`
	PlayTime  string `gorm:"type:varchar(30);commit:播放时间;"`
	Content   string `gorm:"type:varchar(30);commit:内容;"`
	Color     string `gorm:"type:varchar(30);commit:颜色;"`
}

func (b *Bullet) BulletAdd(DB *gorm.DB) error {
	var err error
	err = DB.Create(&b).Error
	return err
}

func (b *Bullet) BulletList(DB *gorm.DB) (list []*__.BulletList, err error) {
	err = DB.Model(&b).Find(&list).Error
	return list, err
}
